package org.opensmile.study.memcachemanager;

import java.io.IOException;
import java.io.Serializable;
import java.net.InetSocketAddress;

import net.spy.memcached.MemcachedClient;

import org.opensmile.study.spring.daoimpl.UserDAOImpl;


public class MemcacheClient implements Serializable{
	
		 /**
	 * 
	 */
	private static final long serialVersionUID = -132806405496538501L;
		{
			String[] serverlist ={"127.0.0.1:11211"};
			try {
				MemcachedClient c =new MemcachedClient(new InetSocketAddress("127.0.0.1", 11211));
				innerCls cls =new innerCls("zc", "123");
				c.set("ke1y", 3600, cls);
				c.set("ke1y1", 3600, cls);
			System.out.println(	c.gets("kely*"));
			
				c.shutdown();
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
		
		
		class innerCls implements Serializable{
			/**
			 * 
			 */
			private static final long serialVersionUID = -2762279820052143675L;
			private String username;
			private String passwd;
			
			public innerCls(String _username,String _passwd){
				this.username=_username;
				this.passwd=_passwd;
			}
			
			
		}
		public static void main(String[] args) {
			MemcacheClient a =new MemcacheClient();
		}
}
